package com.ruoyi.cs.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cs.mapper.TExchangeMapper;
import com.ruoyi.cs.domain.TExchange;
import com.ruoyi.cs.service.ITExchangeService;

/**
 * 用户兑换记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-03-25
 */
@Service
public class TExchangeServiceImpl implements ITExchangeService 
{
    @Autowired
    private TExchangeMapper tExchangeMapper;

    /**
     * 查询用户兑换记录
     * 
     * @param dhId 用户兑换记录ID
     * @return 用户兑换记录
     */
    @Override
    public TExchange selectTExchangeById(String dhId)
    {
        return tExchangeMapper.selectTExchangeById(dhId);
    }

    /**
     * 查询用户兑换记录列表
     * 
     * @param tExchange 用户兑换记录
     * @return 用户兑换记录
     */
    @Override
    public List<TExchange> selectTExchangeList(TExchange tExchange)
    {
        return tExchangeMapper.selectTExchangeList(tExchange);
    }

    /**
     * 新增用户兑换记录
     * 
     * @param tExchange 用户兑换记录
     * @return 结果
     */
    @Override
    public int insertTExchange(TExchange tExchange)
    {
        tExchange.setCreateTime(DateUtils.getNowDate());
        return tExchangeMapper.insertTExchange(tExchange);
    }

    /**
     * 修改用户兑换记录
     * 
     * @param tExchange 用户兑换记录
     * @return 结果
     */
    @Override
    public int updateTExchange(TExchange tExchange)
    {
        tExchange.setUpdateTime(DateUtils.getNowDate());
        return tExchangeMapper.updateTExchange(tExchange);
    }

    /**
     * 批量删除用户兑换记录
     * 
     * @param dhIds 需要删除的用户兑换记录ID
     * @return 结果
     */
    @Override
    public int deleteTExchangeByIds(String[] dhIds)
    {
        return tExchangeMapper.deleteTExchangeByIds(dhIds);
    }

    /**
     * 删除用户兑换记录信息
     * 
     * @param dhId 用户兑换记录ID
     * @return 结果
     */
    @Override
    public int deleteTExchangeById(String dhId)
    {
        return tExchangeMapper.deleteTExchangeById(dhId);
    }
}
